package practice1_100;

public class Practice633 {
    public boolean judgeSquareSum(int c) {
        int right =(int) Math.sqrt(c);
        int left=0;
        while (left<=right){
            if(left*left+right*right==c) return true;
            else if(left*left+right*right>c){
                right--;
            } else {
                left++;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        System.out.println(new Practice633().judgeSquareSum(16));
    }
}
